﻿using System.Data.Entity.ModelConfiguration;
using Nop.Plugin.Pricing.PreciousMetals.Domain;

namespace Nop.Plugin.Pricing.PreciousMetals.Data
{
    public class PreciousMetalsDetailMap : EntityTypeConfiguration<PreciousMetalsDetail>
    {
        public PreciousMetalsDetailMap()
        {
            this.ToTable("PreciousMetalsDetail");
            this.HasKey(x => x.Id);
            
            this.Property(x => x.ProductVariantId);
            this.Property(x => x.MetalType);
            this.Property(x => x.QuoteType);
            this.Property(x => x.Weight).HasPrecision(18, 4);
            this.Property(x => x.PercentMarkup).HasPrecision(18, 4);
            this.Property(x => x.FlatMarkup).HasPrecision(18, 4);
            this.Property(x => x.TierPriceType);
            this.Property(x => x.MathType);
            this.Property(x => x.LowerAmount);
            this.Property(x => x.PriceRounding);
            this.Property(x => x.PriceRoundingType);
        }
    }
}
